<template>
  <div class='container'>
    <el-dialog
  title="题目审核"
  :visible="checkVisible"
  width="30%"
  @close="checkClose">
  <el-radio-group v-model="chkState">
    <el-radio :label="1" value="1">通过</el-radio>
    <el-radio :label="2" value="2">拒绝</el-radio>
  </el-radio-group>
  <el-input
      type="textarea"
      :rows="2"
      placeholder="请输入内容"
      v-model="textarea"
      style="margin-top:30px">
  </el-input>
  <!-- <el-row type="flex" justify="end"> -->
  <span slot="footer" class="dialog-footer" type="flex" justify="end">
    <el-row type="flex" justify="end">
      <el-button @click="checkClose">取 消</el-button>
      <el-button type="primary" @click="submit">确 定</el-button>
    </el-row>
  </span>
  <!-- </el-row> -->
</el-dialog>
  </div>
</template>

<script>
import { choiceCheck } from "@/api/hmmm/questions.js";
  export default {
    data() {
      return {
        chkState:1,
        textarea:''
      };
    },
    props:{
      checkVisible:{
        type:Boolean,
        default:false
      },
      checkId:{
        type:Number,
        required:true
      }
    },
    methods: {
      checkClose(){
        this.$emit('check-close')
      },
      async submit(){
        if (this.textarea === '') {
          return this.$message.warning('请输入审核意见')
        }
        await choiceCheck({chkState:this.chkState,chkRemarks:this.textarea,id:this.checkId})
        this.$message.success('成功了')
        this.textarea = ''
        this.checkClose()
        this.$emit('get-question-choice')
      }
    }
  };
</script>


<style scoped lang='less'></style>
